package com.xuelang.pipeline.domain.project.service.impl;

import com.xuelang.pipeline.client.common.result.PageRecord;
import com.xuelang.pipeline.client.project.dto.ProjectQuery;
import com.xuelang.pipeline.domain.project.Project;
import com.xuelang.pipeline.domain.project.repository.ProjectRepository;
import com.xuelang.pipeline.domain.project.service.ProjectDomainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>项目域服务实现类</p>
 *
 * @author : yixin.lys
 * @date : 2024-09-02 15:56
 **/
@Service
public class ProjectDomainServiceImpl implements ProjectDomainService {

    @Autowired
    private ProjectRepository repository;

    @Override
    public PageRecord<Project> pageProjects(long currentPage, long pageSize, ProjectQuery projectQuery) {
        return repository.pageProjects(currentPage, pageSize, projectQuery);
    }

    @Override
    public Integer createProject(Project project) {
        return repository.createProject(project);
    }

    @Override
    public boolean deleteProjectById(Integer id) {
        return repository.deleteProjectById(id);
    }

    @Override
    public boolean updateProject(Project project) {
        return repository.updateProject(project);
    }

    @Override
    public Project findProjectById(Integer id) {
        return repository.findProjectById(id);
    }

    @Override
    public Project findProjectByCode(String code) {
        return repository.findProjectByCode(code);
    }

    @Override
    public List<Project> findAllProjects() {
        return repository.findAllProjects();
    }
}
